<?php require_once('../../core/import.php');?>
<?php User::Permission('ACCOUNT_UPDATE'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <script type="text/javascript" src="../../scripts/import.js"></script>
    <script type="text/javascript" src="../../scripts/components/kindeditor/import.kindeditor.js"></script>
	<script type="text/javascript" src="../../../scripts/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="../../../scripts/jquery.plugins/province_city.js"></script>        
    <script type="text/javascript" src="scripts/edit.js"></script>   
</head>

<body>
    <form id="Form1" name="Form1" method="post" action="edit.action.php" class="Form" enctype="multipart/form-data">
        <?php
	 	#赋值检测
  		if(!is_numeric($ID=Functions::UrlArgs('id'))) exit('信息ID不正确');
    	$Location=Functions::UrlArgs('location');
 	 	#获取数据
	 	$Rows=DB::GetRowByID('account',$ID);
	 ?> 
        <fieldset>
            <legend>会员修改</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="98" height="25" align="left">用户名：</td>
                <td width="987" colspan="2">
                     <input type="text" name="username" id="username" onBlur="callServer();" maxlength="80" class="Textbox" value="<?php echo $Rows['Username']?>" /><font color="red">*</font> <span id="username_aj" >&nbsp;</span>
                </td>
            </tr>
            <tr>
                <td width="98" height="25" align="left">密码：</td>
                <td width="987" colspan="2">
                    <input type="password" id="Password" name="Password" maxlength="80" class="Textbox" /> 不修改请留空</td>
            </tr>
            <tr>
                <td width="98" height="25" align="left">确认密码：</td>
                <td width="987" colspan="2">
                    <input type="password" id="Password_again" name="Password_again" maxlength="80" class="Textbox" /></td>
            </tr>
               </table>
        </fieldset>
	  <fieldset>
            <legend>基本信息</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
            <tr>
                <td width="92" height="25" align="left">公司名称：</td>
                <td>
                    <input type="text" id="CompanyName" name="CompanyName" value="<?php echo $Rows['CompanyName'];?>" maxlength="80" class="Textbox" />
                </td>
                <td width="117" height="25" align="left">经营模式：</td>
                <td width="527" >
                     <input name="Model" type="radio" class="radio" value="PRODUCTION" <?php if($Rows['Model']=='PRODUCTION'){ echo 'checked' ;}?>>
                     <span class="rad_txt">生产加工</span>
                     <input name="Model" type="radio" class="radio" value="WHOLESALE" <?php if($Rows['Model']=='WHOLESALE'){ echo 'checked' ;}?>>
                     <span class="rad_txt">经销批发</span>
                     <input name="Model" type="radio" class="radio" value="BUSINESS" <?php if($Rows['Model']=='BUSINESS'){ echo 'checked' ;}?>>
                     <span class="rad_txt">招商代理</span>
                     <input name="Model" type="radio" class="radio" value="SERVICE" <?php if($Rows['Model']=='SERVICE'){ echo 'checked' ;}?>>
                     <span class="rad_txt">商业服务</span>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">注册资本：</td>
                <td >
                    <input type="text" id="RegisterdCapital" name="RegisterdCapital" value="<?php echo $Rows['RegisterdCapital'];?>" class="Textbox" />
                </td>
                <td width="117" height="25" align="left">成立时间：</td>
                <td width="527" >
                    <input type="text" id="EstablishedTime" name="EstablishedTime" value="<?php echo $Rows['EstablishedTime'];?>" maxlength="80" class="Textbox" />
                </td>
            </tr>
            <tr>
            	<td height="110" align="left" valign="top">主营行业：</td>
            	<td height="110" colspan="3">
                    <table border="0" width="100%">
                    <tbody>
                    <tr>
                    <td >
                    <select id="Trade_Class" name="Trade_Class" size="8">
					<?php 
                    $Data_Trade=DB::GetRows('select * from trade where Identifying_Parent is NULL order by ID asc');
                    foreach($Data_Trade as $Row)
                    {
                    ?>
                    	<option value="<?php echo $Row['Identifying'];?>"><?php echo $Row['Name'];?></option>
                    <?php 
                    }
                    ?>
                    </select>
                    &nbsp;&nbsp;
                    <select id="Trade_Subclass" name="Trade_Subclass" size="8" style="width:300px">
                    </select>
                    
                    <br><input id="Trade_Add" name="Trade_Add" type="image" src="/images/reg_y_btn01.gif" class="btn">
                    <input id="Trade_Delete" name="Trade_Delete" type="image" src="/images/reg_y_btn02.gif" class="btn">
                    </td>
                    </tr>
                    <tr>
                    <td>
                    <select id="Trade_Result" name="Trade_Result" style="width:360px;" size="8">
                    <?php
					if($Rows['Trade_Subclass'])
					{
						//exit('select * from trade where Identifying in('.Filter::Mysql_Contact($Rows['Trade_Subclass']).') order by ID desc');
                    	$Data_Trade_Sub=DB::GetRows('select * from trade where Identifying in('.Filter::Mysql_Contact($Rows['Trade_Subclass'],',').') order by ID desc');
                    	foreach($Data_Trade_Sub as $Row_Trade)
                    	{
					?>
                    	<option value="<?php echo $Row_Trade['Identifying_Parent'];?>-<?php echo $Row_Trade['Identifying'];?>"><?php echo $Row_Trade['Name'];?></option>
                    <?php 
                    	}
					}
                    ?>  
                    </select>
                    <input id="Trade_Class_Value" name="Trade_Class_Value" type="hidden" style="width:300px;" value="<?php echo $Rows['Trade_Class'];?>" />
                    <input id="Trade_Subclass_Value" name="Trade_Subclass_Value" type="hidden" style="width:300px;" value="<?php echo $Rows['Trade_Subclass'];?>" />                                                            
                    </td>
                    </tr>
                    </tbody>
                    </table>           
				</td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">&nbsp;</td>
                <td>&nbsp;</td>
                <td width="117" height="25" align="left">合作伙伴：</td>
                <td width="527">
                    <input type="text" id="Partner" name="Partner" maxlength="80" class="Textbox" value="<?php echo $Rows['Partner'];?>"/>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">主营产品：</td>
                <td>
                    <input type="text" id="Product" name="Product" maxlength="80" class="Textbox" value="<?php echo $Rows['Product'];?>"/>
                </td>
                <td width="117" height="25" align="left">省、市：</td>
                <td width="527"> 
                    <select name="Province" id="Province">
                    </select>
                    <select name="City" id="City">
                    </select>
                    <?php
						$Province=$Rows['Province'];
						$City=$Rows['City'];
                    	if(!$Province&&!$City){
							$Province=35;
							$City=0;	
						}
					?>
                    <input type="hidden" id="ProvinceValue" name="ProvinceValue" maxlength="80" class="Textbox" value="<?php echo $Province;?>"/>
                    <input type="hidden" id="CityValue" name="CityValue" maxlength="80" class="Textbox" value="<?php echo $City;?>"/>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">公司地址：</td>
                <td>
                    <input type="text" id="Address" name="Address" maxlength="80" class="Textbox" value="<?php echo $Rows['Address'];?>"/>
                </td>
                <td width="117" height="25" align="left">联系人：</td>
                <td width="527">
                    <input type="text" id="Linkman" name="Linkman" maxlength="80" class="Textbox" onBlur="LinkmanServer();" value="<?php echo $Rows['Linkman'];?>"/><font color="red"> *</font> <span id="Linkman_aj" >&nbsp;</span>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">性别：</td>
                <td>
                    <input type="text" id="Sex" name="Sex" maxlength="80" class="Textbox" value="<?php echo $Rows['Sex'];?>"/>
                </td>
                <td width="117" height="25" align="left">部门：</td>
                <td width="527">
                    <input type="text" id="Department" name="Department" maxlength="80" onBlur="DepartmentServer();" class="Textbox" value="<?php echo $Rows['Department'];?>"/><font color="red"> *</font> <span id="Department_aj" >&nbsp;</span>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">职位：</td>
                <td>
                    <input type="text" id="Position" name="Position" maxlength="80" onBlur="PositionServer();" class="Textbox" value="<?php echo $Rows['Position'];?>"/></td>
                <td width="117" height="25" align="left">网站URL：</td>
                <td width="527">
                    <input type="text" id="URL" name="URL" maxlength="80" class="Textbox" value="<?php echo $Rows['URL'];?>"/>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">联系电话：</td>
                <td>
                    <input type="text" id="Phone" name="Phone" maxlength="80" class="Textbox" value="<?php echo $Rows['Phone'];?>"/>
                </td>
                <td width="117" height="25" align="left">传真：</td>
                <td width="527">
                    <input type="text" id="Fax" name="Fax" maxlength="80" class="Textbox" value="<?php echo $Rows['Fax'];?>"/>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">移动电话：</td>
                <td>
                    <input type="text" id="MSISDN" name="MSISDN" maxlength="80" class="Textbox" value="<?php echo $Rows['MSISDN'];?>"/>
                </td>
                <td width="117" height="25" align="left">QQ：</td>
                <td width="527">
                    <input type="text" id="QQ" name="QQ" maxlength="80" class="Textbox" value="<?php echo $Rows['QQ'];?>"/>
                </td>
            </tr>
            <tr>
                <td width="92" height="25" align="left">MSN：</td>
                <td>
                    <input type="text" id="MSN" name="MSN" maxlength="80" class="Textbox" value="<?php echo $Rows['MSN'];?>"/>
                </td>
             	<td height="25" align="left" valign="middle">公司LOGO：</td>
            	<td><input type="File" id="Logo" name="Logo" class="Textbox" value="<?php echo $Rows['Logo'];?>"/></td>
            </tr>
            
            <tr>
                <td width="92" height="25" align="left">公司简介：</td>
                <td colspan="3"><label for="textarea"></label>
                    <textarea name="Intro" id="Intro" style="width:70%; height:300px;"><?php echo $Rows['Intro'];?></textarea>
                </td>
            </tr>
      	
               </table>
        </fieldset>
        <fieldset>
            <legend>会员状态</legend>
            <table width="100%" cellpadding="1" cellspacing="0">
             <tr>
                <td width="99" height="25" align="left">邮件验证：</td>
                <td width="986">
                <?php	
			$data_email=DB::GetRows('select Account from `account_email_verification` where Account=\''.$Rows['Username'].'\'');
			$data_locked=DB::GetRows('select Account from `account_locked` where Account=\''.$Rows['Username'].'\'');
			$data_vip=DB::GetRows('select Account from `account_vip` where Account=\''.$Rows['Username'].'\'');
			$data_integrity=DB::GetRows('select Account from `account_integrity` where Account=\''.$Rows['Username'].'\'');
			$data_powerful=DB::GetRows('select Account from `account_powerful` where Account=\''.$Rows['Username'].'\'');
                ?>
                    <input type="radio" name="M_Email" value="1" <?php if(count($data_email)>0){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_Email" value="0" <?php if(count($data_email)==0){ echo 'checked' ;}?>/> 否 
                </td>
            </tr>
            <tr>
                <td width="99" height="25" align="left">锁定：</td>
                <td width="986">
                    <input type="radio" name="M_locked" value="1" <?php if(count($data_locked)>0){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_locked" value="0" <?php if(count($data_locked)==0){ echo 'checked' ;}?>/> 否 
                </td>
            </tr>
             <tr>
                <td width="99" height="25" align="left">VIP：</td>
                <td width="986">
                    <input type="radio" name="M_Vip" value="1" <?php if(count($data_vip)>0){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_Vip" value="0" <?php if(count($data_vip)==0){ echo 'checked' ;}?>/> 否 
                </td>
            </tr>
             <tr>
                <td width="99" height="25" align="left">诚信供应商：</td>
                <td width="986">
                    <input type="radio" name="M_Integrity" value="1" <?php if(count($data_integrity)>0){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_Integrity" value="0" <?php if(count($data_integrity)==0){ echo 'checked' ;}?>/> 否 
                </td>
            </tr>
             <tr>
                <td width="99" height="25" align="left">置顶：</td>
                <td width="986">
                    <input type="radio" name="M_IsTop" value="1" <?php if($Rows['M_IsTop']==1){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_IsTop" value="0" <?php if($Rows['M_IsTop']==0){ echo 'checked' ;}?>/> 否 
                </td>
            </tr>
             <tr>
             <td height="25" align="left">强企推荐：</td>
             <td>
                    <input type="radio" name="M_IsPowerful" value="1" <?php if(count($data_powerful)>0){ echo 'checked' ;}?>/> 是&nbsp;
	  			<input type="radio" name="M_IsPowerful" value="0" <?php if(count($data_powerful)==0){ echo 'checked' ;}?>/> 否              
             </td>
             </tr>
               </table>
        </fieldset>
        <input type="hidden" id="location" name="location" value="<?php echo $Location?>" />
        <input type="hidden" id="ai" name="ai" value="<?php echo $ID?>" />
        <input id="ActionButton" name="ActionButton" type="submit" value="确定" class="button" /> 
        <input id="ResetButton" name="ResetButton" type="reset" value="重置" class="button" />
    </form>
</body>
</html>